﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace DX.Learning.SimpleUserControlInsertion
{
    public partial class BaseControlView<TController> : XtraUserControl , IView<TController>
            // where TController : DataSetController<SchoolSystemDbDataSet>, new()
            // where TController : SchoolSystemController, new()
            // where TController : ViewBagController<SchoolModelBag>, new()
            where TController    : /*ModelController<Model>*/ new() 
        //BUG : why does this constraint leads to implicit reference cast bug ?
            
    
    {
 

        /// <summary>,
        /// Initializes a new instance of 
        /// the <see cref="BaseControlView{TController}"/> class.
        /// </summary>
        public BaseControlView()
        {
            //InitializeComponent();
            Controller = new TController();
        }


        #region -- IView<TController> members --
        
        /// <summary>
        /// Gets or sets the controller.
        /// </summary>
        public TController Controller   { get; set; }

        /// <summary>
        /// Gets or sets the name of the view.
        /// </summary>
        public string ViewName          { get; set; }


        #endregion 
    }
}
